/**
 * 建立索引需要包含一下几个视图
Ontology的
CREATE 
    ALGORITHM = UNDEFINED 
    DEFINER = `root`@`%` 
    SQL SECURITY DEFINER
VIEW `biosearch`.`XX_synonyms` AS
    SELECT 
        `a`.`acc` AS `acc`,
        `b`.`term_synonym` AS `synonym`,
        `b`.`acc_synonym` AS `alter_synonym`,
        `b`.`synonym_type_name` AS `synonym_type`
    FROM
        (`biosearch`.`XX_term` `a`
        JOIN `biosearch`.`XX_term_synonym` `b`)
    WHERE
        (`a`.`primary_id` = `b`.`term_id`);
GeneSymbol的
CREATE 
    ALGORITHM = UNDEFINED 
    DEFINER = `root`@`%` 
    SQL SECURITY DEFINER
VIEW `biosearch`.`geneid_symbol` AS
    SELECT 
        `biosearch`.`hgnc_complete_set`.`entrez_gene_id` AS `entrez_gene_id`,
        `biosearch`.`hgnc_complete_set`.`approved_symbol` AS `approved_symbol`,
        `biosearch`.`hgnc_complete_set`.`synonyms` AS `synonyms`
    FROM
        `biosearch`.`hgnc_complete_set`
    WHERE
        ((`biosearch`.`hgnc_complete_set`.`status` = 'Approved')
            AND (`biosearch`.`hgnc_complete_set`.`entrez_gene_id` IS NOT NULL));
            
//biodata
 * CREATE 
    ALGORITHM = UNDEFINED 
    DEFINER = `root`@`%` 
    SQL SECURITY DEFINER
VIEW `XX_term_id_synonym` AS
    SELECT 
        `a`.`primary_id` AS `primary_id`,
        `a`.`ent_name` AS `ent_name`,
        `b`.`synonym` AS `synonym`,
        `b`.`alter_synonym` AS `alter_synonym`,
        `b`.`synonym_type` AS `synonym_type`
    FROM
        (`biodata`.`index_term` `a`
        JOIN `biosearch`.`XX_synonyms` `b`)
    WHERE
        ((`a`.`source_table` = 'XX_term')
            AND (`a`.`db_id` = `b`.`acc`));

CREATE 
    ALGORITHM = UNDEFINED 
    DEFINER = `root`@`%` 
    SQL SECURITY DEFINER
VIEW `gene_term_id_synonym` AS
    SELECT 
        `a`.`primary_id` AS `primary_id`,
        `b`.`entrez_gene_id` AS `entrez_gene_id`,
        `b`.`approved_symbol` AS `approved_symbol`,
        `b`.`synonyms` AS `synonyms`
    FROM
        (`biodata`.`index_term` `a`
        JOIN `biosearch`.`geneid_symbol` `b`)
    WHERE
        ((`a`.`db_id` = `b`.`entrez_gene_id`)
            AND (`a`.`ent_type` = 'gene_id'));

 */
/**
 * @author burkun
 *
 */
package org.hit.burkun.index.term;